﻿using System;
using MemoryPack;

namespace Hsenl {
    [Serializable]
    [MemoryPackable]
    public partial class BitlistEnum<T> where T : Enum {
        [MemoryPackInclude]
        private Bitlist _bitlist = new();
        
        public bool IsNullOrEmpty() {
            return this._bitlist.IsNullOrEmpty();
        }

        public void Set(BitlistEnum<T> other) {
            this._bitlist.Set(other._bitlist);
        }

        public void Add(T value) {
            this._bitlist.Add(value);
        }

        public void Remove(T value) {
            this._bitlist.Remove(value);
        }

        public bool Contains(T value) {
            return this._bitlist.Contains(value);
        }

        public void Clear() {
            this._bitlist.Clear();
        }

        public override string ToString() {
            return this._bitlist.ToString();
        }
    }
}